{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		{include admin.inc.menu}
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<ul class="nav nav-tabs">

					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 添加导航设置</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 导航设置列表</a></li>
					<!--<li><a href="/admin/index/edit"><i class="glyphicon glyphicon-edit"></i> 编辑导航设置</a></li>-->

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form">
						<!-- search form start -->
						<!--tmpl-search-->

						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									导航名称
								</div>
								<input type="text" class="form-control input-sm" maxlength="20" placeholder="导航名称" name="s_name" value="{$s_name}">
							</div>
						</div>
						
						
						
						
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									显示
								</div>
								<select id="s_display" class="form-control input-sm" name="s_display">
									<option value="">-- 请选择 --</option>
									<!--tmpl-options-->
									<option {if $s_display==1}selected="selected"{/if} value="1">显示</option>
									<option {if $s_display===0}selected="selected"{/if} value="0">隐藏</option>
								</select>
							</div>
						</div>
						
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									新窗口打开
								</div>
								<select id="s_blank" class="form-control input-sm" name="s_blank">
									<option value="">-- 请选择 --</option>
									<!--tmpl-options-->
									<option {if $s_blank==1}selected="selected"{/if} value="1">显示</option>
									<option {if $s_blank===0}selected="selected"{/if} value="0">隐藏</option>
								</select>
							</div>
						</div>
						
						
						

						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						<!-- search form end -->
					</form>
					<form id="J_List_Form">
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>导航名称<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="name ASC"}name DESC{else}name ASC{/if}' class='fa ofield {if $order=="name ASC"}fa-chevron-up{elseif $order=="name DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>链接地址<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="url ASC"}url DESC{else}url ASC{/if}' class='fa ofield {if $order=="url ASC"}fa-chevron-up{elseif $order=="url DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>添加时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="addtime ASC"}addtime DESC{else}addtime ASC{/if}' class='fa ofield {if $order=="addtime ASC"}fa-chevron-up{elseif $order=="addtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>修改时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="edittime ASC"}edittime DESC{else}edittime ASC{/if}' class='fa ofield {if $order=="edittime ASC"}fa-chevron-up{elseif $order=="edittime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>显示<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="display ASC"}display DESC{else}display ASC{/if}' class='fa ofield {if $order=="display ASC"}fa-chevron-up{elseif $order=="display DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>新窗口打开<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="blank ASC"}blank DESC{else}blank ASC{/if}' class='fa ofield {if $order=="blank ASC"}fa-chevron-up{elseif $order=="blank DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>添加人<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="manager_id ASC"}manager_id DESC{else}manager_id ASC{/if}' class='fa ofield {if $order=="manager_id ASC"}fa-chevron-up{elseif $order=="manager_id DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
								
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="9" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[name]}</td>
									<td>{$value[url]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[edittime]}</td>
									<td>
										{if $value[name]=='首页' ||$value[name]=='交易市场'}
										<a class="btn btn-primary btn-xs disabled" title="系统默认不可编辑">系统默认</a>
										{else}
										<input type='checkbox' data-id="{$value[id]}" data-on-text='&nbsp;是' data-off-text='否' class='bswitch js-display' data-size='mini' {if $value[display]}checked{/if} >
										{/if}
									</td>
									<td>
										{if $value[name]=='首页' ||$value[name]=='交易市场'}
										<a class="btn btn-primary btn-xs disabled" title="系统默认不可编辑">系统默认</a>
										{else}
										<input type='checkbox' data-id="{$value[id]}" data-on-text='&nbsp;是' data-off-text='否' class='bswitch js-blank' data-size='mini' {if $value[blank]}checked{/if} >
										{/if}
									</td>
									<td>{$value[manager_name]}</td>
									<td>
										{if $value['is_default']==1}
										<a class="btn btn-primary btn-xs disabled">系统默认</a>
										{else}
										<!-- listbtnedit -->
										{if in_array('admin/nav/edit',$priv) || empty($priv)}
										<a href="{$edit_url}?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										
										<!-- listbtndelete -->
										{if in_array('admin/nav/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
										{/if}
									</td>
								</tr>
								{/loop}
							</table>
						</div>
					</form>
					<div class="button-group" style="float: left">
						{if in_array('admin/nav/delete',$priv) || empty($priv)}
						<button class="btn btn-danger js-deletes btn-sm">批量删除</button>
						{/if}
					</div>
					<div class="text-right">
						{$pagemenu}
					</div>
				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- template -->
<script id="editpanel" type="text/html">
	<div>
		<form id="editpanel-form" class="form-horizontal">
			<div class="row">&nbsp</div>
			<!--tmpl-fieldlist-->

			<!-- input -->
			<div class="form-group">
				<label >导航名称 </label>
				<input  dtype="" class="form-control" maxlength="20" name="data[name]" placeholder="导航名称" required cname="导航名称" value="{[name]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >链接地址 </label>
				<input  dtype="url" class="form-control" maxlength="255" name="data[url]" placeholder="链接地址" required cname="链接地址" value="{[url]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- switch -->
			<div class="form-group">
				<label>显示</label>
				<div>
					<input type="checkbox" id="switch-display" name="data[display]" class="bswitch" data-size="normal" {if $item[display]}checked{/if} data-on-text="{on}" data-off-text="{off}">
				</div>
			</div>
			
			<!-- switch -->
			<div class="form-group">
				<label>新窗口打开</label>
				<div>
					<input type="checkbox" id="switch-blank" name="data[blank]" class="bswitch" data-size="normal" {if $item[blank]}checked{/if} data-on-text="{on}" data-off-text="{off}">
				</div>
			</div>
			

			<!--tmpl-assocfields-->
		</form>
	</div>
</script>

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/admin_navindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->
		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>

<!--<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li>
		{[loop pages page]}

		<li {[if curr == page]}class="active"{[/if]}><a class="assoc-page" data-page="{[page]}"  href="javascript:void(0)">{[page]}</a></li>

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li>
	</ul>
</div>
</script>-->
</body>
</html>
